<div i="content" class="ui-dialog-content picture_manager">
    <form name="iform" style="width:620px;padding: 0 10px;">
        <table width="100%">
            <tbody>
            <tr>
                <td align="right" class="pr10 pt16 first" valign="top">图片类型<span class="c-red">* </span>：</td>
                <td class="pt12 picture_type" valign="top">
                    <ul>
                        <a href="javascript:;" ng-repeat="(index, pic) in picType">
                            <li ng-class="{'active': data.type == index}"
                                ng-model="data.type"
                                ng-click="data.type = index">
                                <span>{{pic}}</span>
                                <div ng-class="{'active': data.type == index}"></div>
                            </li>
                        </a>
                    </ul>
                </td>
            </tr>
            <tr>
                <td align="right" class="pr10 pt16 first" valign="top">主题<span class="c-red">* </span>：</td>
                <td class="pt12" valign="top">
                    <input type="text" ng-model="data.title" name="title"
                           class="input-text fl mr10" required>
                    <div ng-messages="iform.title.$error"
                         ng-show="iform.$submitted || iform.title.$touched">
                        <p class="c-red lh30" ng-message="required">主题不能为空</p>
                    </div>
                </td>
            </tr>
            <tr>
                <td align="right" class="pr10 pt16 first" valign="top">图文地址：</td>
                <td class="pt12" valign="top">
                    <input type="url" ng-model="data.redirect_url" name="redirect_url"
                           class="input-text fl mr10">
                    <div ng-messages="iform.redirect_url.$error"
                         ng-show="iform.$submitted || iform.redirect_url.$touched">
                        <p class="c-red lh30" ng-message="url">url格式不对</p>
                    </div>
                </td>
            </tr>
            <tr>
                <td align="right" class="pr10 pt16 first" valign="top">是否启用：</td>
                <td class="pt12 picture_type" valign="top">
                    <ul>
                        <a href="javascript:;" ng-repeat="(index, ab) in isAble">
                            <li ng-class="{'active': data.is_able == +!index}"
                                ng-model="data.is_able"
                                ng-click="data.is_able = +!index">
                                <span>{{ab}}</span>
                                <div ng-class="{'active': data.is_able == +!index}"></div>
                            </li>
                        </a>
                    </ul>
                </td>
            </tr>
            <tr>
                <td align="right" class="pr10 pt16 first" valign="top">显示顺序<span class="c-red">* </span>：</td>
                <td class="pt12" valign="top">
                    <input type="number" ng-model="data.sort" name="sort"
                           placeholder="数字越小越靠前"
                           ng-pattern="/^\d+$/"
                           class="input-text fl mr10" required>
                    <div ng-messages="iform.sort.$error"
                         ng-show="iform.$submitted || iform.sort.$touched">
                        <p class="c-red lh30" ng-message="required">显示顺序不能为空</p>
                        <p class="c-red lh30" ng-message="pattern">数字格式不正确</p>
                    </div>
                </td>
            </tr>
            <tr>
                <td align="right" class="pr10 pt16 first" valign="top">图片<span class="c-red">* </span>：</td>
                <td class="pt12" valign="top">
                    <div id="image_load" class="content table-cell">
                        <div id="upload_button">
                            <div>+</div>
                            <p>上传图片</p></div>
                    </div>
                    <div class="image-upload-container">
                        <div id="preview_container" style="position: relative;"></div>
                        <div class="controllbar table" style="position: absolute;">
                            <div class="upload table-cell" style="">重新上传</div>
                            <div class="cancel table-cell" style="">删除</div>
                        </div>
                    </div>
                    <input type="text" name="picture" ng-show="false" ng-model="data.picture" required>
                    <div ng-messages="iform.picture.$error"
                         ng-show="iform.$submitted || iform.picture.$touched">
                        <p class="c-red lh30" ng-message="required">图片不能为空</p>
                    </div>
                </td>
            </tr>
            <tr ng-if="data.type == 1">
                <td class="c-gray pt12" style="padding-left: 120px" colspan="2">推荐尺寸：780px*550px，大小限制200KB</td>
            </tr>
            <tr ng-if="data.type == 2">
                <td class="c-gray pt12" style="padding-left: 120px" colspan="2">推荐尺寸：1030px*130px，大小限制200KB</td>
            </tr>
            <tr ng-if="data.type == 1">
                <td align="right" class="pr10 pt16 first" valign="top">底图背景色<span class="c-red">*</span>：</td>
                <td class="pt12" valign="top">
                    <input type="text" ng-model="data.bg_color" name="bg_color"
                           class="input-text fl mr10" required>
                    <div ng-messages="iform.bg_color.$error"
                         ng-show="iform.$submitted || iform.bg_color.$touched">
                        <p class="c-red lh30" ng-message="required">底图背景色不能为空</p>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>
    </form>
    <div style="display: none;">
        <form action="#" enctype="multipart/form-data" method="post" name="picture_manager_form"
              role="image-upload-file-form">
            <input name="file" role="image-upload-file-input" accept="image/*"
                   style="display:none;"
                   ng-model="data.picture"
                   type="file">
        </form>
    </div>
    <input type="hidden" name="image_url" id="image_url"
           ng-model="data.picture" value="{{data.picture}}">
</div>